package com.hs.thread.communication.wait.pipe;

import java.io.IOException;
import java.io.PipedOutputStream;

/**
 * TODO
 *
 * @author hushe
 * @date 2020/7/16/0016 17:57
 * @email husheng3921@163.com
 */
public class WriteData {
    public void writeMethod(PipedOutputStream out){
        try{
            System.out.println("write:");
            for(int i = 0; i < 300;i++){
                String outData = ""+(i+1);
                out.write(outData.getBytes());
                System.out.print(outData);
            }
            System.out.println();
            out.close();
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
